home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4168 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.2 KB  |  53 lines

  1. Path: news.pi.net!news
  2. From: heggie <heggie@pi.net>
  3. Newsgroups: comp.lang.c++
  4. Subject: class INTERFACE declaration ??
  5. Date: Sun, 28 Jan 1996 17:44:31 -0800
  6. Organization: heggie
  7. Message-ID: <310C267F.78BC@pi.net>
  8. NNTP-Posting-Host: gro28.pi.net
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0b5 (Win16; I)
  13.  
  14. I'm trying to implement a Date class who exists
  15. of three int fields and some interfaces, with the
  16. last thing i'm having some problems
  17. (ps using borlands c++ for windows)
  18. I can't think of a reason why the interface declaration
  19. of setdate is wrong, anybody outhere maybe????
  20.  
  21. THANKs in advantage,
  22.  
  23. #include <stdio.h>
  24. #include <stdlib.h>
  25. #include <string.h>
  26. #include <iostream.h>
  27.  
  28. class Date
  29. {
  30.     public:
  31.         void setdate (int d, int m, int y);
  32.         void printdate ();
  33.         void nextday();
  34.  
  35.     private:
  36.         int
  37.             day,
  38.             month,
  39.             year;
  40. }
  41.  
  42. void Date::setdate (int d, int m, int y)
  43. {
  44. .........
  45. }
  46.  
  47. ************************************************
  48. Compiling ..\SOURCES\OPDR_48.CPP:
  49. Error ..\SOURCES\OPDR_48.CPP 21: Too many types in declaration
  50. Error ..\SOURCES\OPDR_48.CPP 22: Type 'Date' may not be defined here
  51. Error ..\SOURCES\OPDR_48.CPP 22: 'Date::setdate(int,int,int)' is not a 
  52. member of 'Date'
  53.